package com.example.networkinteraction.request.param;

import okhttp3.FormBody;
import okhttp3.RequestBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Description: 加密请求参数
 * File: EncryptRequestParam.java
 * Author: Administrator
 * Create: 2019/4/2 0002 下午 13:17
 */
public class EncryptRequestParam extends RequestParam {
    @Override
    public RequestBody buildRequestBody() {
        FormBody.Builder builder = new FormBody.Builder();
        Map<String, String> map = getEncryptMap();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            builder.add(entry.getKey(), entry.getValue());
        }
        return builder.build();
    }

    private Map<String, String> getEncryptMap() {
        Map<String, String> map = new HashMap<>();
        //添加自己的加密逻辑
        map.put("", "");
        return map;
    }
}
